
// 通过 Symbol 来使这个属性不被外部所知,变相实现 静态属性；
const PASSWORD = Symbol();
class Login {
    
    constructor(username,password) {
        
        this.username = username;
        this[PASSWORD] = password;

    }

    checkPassword(pwd) {
        
        return this[PASSWORD] == pwd;
    }
}

const p = new Login('daxai','8888888');

console.log(p.checkPassword('8888888'));



